import java.util.ArrayList;
import java.util.Scanner;


public class Classes {
public static void main(String args[]){
	ArrayList<String>randomWords=new ArrayList<String>(); 
	String Word;
	String in1;
	boolean p=true;
	while(p==true){
		Scanner in=new Scanner(System.in);
		in1=in.nextLine();	
		if (in1.equalsIgnoreCase("Stop")){
			p=false;
		}
		else {
			randomWords.add(in1);
	} 
		
}		for(int x=0; x<randomWords.size(); x++){
			for(int z=x; z<randomWords.size(); z++){
				if (randomWords.get(x).compareToIgnoreCase(randomWords.get(z))>0){
					Word=randomWords.get(x);
					randomWords.set(x, randomWords.get(z));
					randomWords.set(z, Word);
				}
				              
		}

		for(int a=0; a<randomWords.size(); a++){        
			System.out.println(randomWords.get(a));
		}
		String o="Andrew_Moeckel";
		System.out.println(o.substring(3, 6));
	}
}